home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
icondr
/
icondemo.frm
< prev
next >
Wrap
Text File
|
1995-05-08
|
2KB
|
90 lines
VERSION 2.00
Begin Form Form1
Caption = "Form1"
ClientHeight = 2895
ClientLeft = 1170
ClientTop = 1545
ClientWidth = 5505
Height = 3300
Left = 1110
LinkMode = 1 'Source
LinkTopic = "Form1"
ScaleHeight = 2895
ScaleWidth = 5505
Top = 1200
Width = 5625
Begin Timer Timer1
Interval = 500
Left = 120
Top = 1200
End
Begin PictureBox Pic
AutoRedraw = -1 'True
AutoSize = -1 'True
Height = 510
Index = 2
Left = 1320
Picture = ICONDEMO.FRX:0000
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 2
Top = 600
Width = 510
End
Begin PictureBox Pic
AutoRedraw = -1 'True
AutoSize = -1 'True
Height = 510
Index = 1
Left = 720
Picture = ICONDEMO.FRX:0302
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 1
Top = 600
Width = 510
End
Begin PictureBox Pic
AutoRedraw = -1 'True
AutoSize = -1 'True
Height = 510
Index = 0
Left = 120
Picture = ICONDEMO.FRX:0604
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 0
Top = 600
Width = 510
End
End
Sub Form_Load ()
'-- show the form as an icon on startup
WindowState = 1
End Sub
Sub Timer1_Timer ()
Static IconNumber
'-- we want IconNumber to be 0 to 3
IconNumber = (IconNumber + 1) Mod 4
Form1.Caption = "Icon" + Str$(IconNumber)
If IconNumber = 3 Then '-- draw something instead of using an icon
'-- first, clear any icon
Form1.Icon = LoadPicture()
'-- now clear the picture
Form1.Picture = LoadPicture()
'-- set width of line to 4
DrawWidth = 4
Form1.Line (0, 0)-(530, 530), QBColor(14), B
Form1.Line (0, 0)-(530, 530), QBColor(12)
Else '-- transfer an icon from one of the pictures on the form
Form1.Icon = Pic(IconNumber).Picture
End If
End Sub